<html>


// 给语句加上标签是为了指定跳出那个循环
<!-- <script>
    // 例子1 
  outer:
  // 当i===1 j===1 时跳出循环outer
    for (let i = 0; i < 3; i++) {
       inner:
        for (let j = 0; j <3; j++) {
            if(i === 1 && j === 1) break outer;
            console.log(i,j);
        }
        
    }

</script> -->

<!-- <script>
    // 例子2
  top:
  // 当i===1 j===1 时跳出循环outer
    for (let i = 0; i < 3; i++) {
       inner:
        for (let j = 0; j <3; j++) {
            if(i === 1 && j === 1) break inner;
            console.log(i,j);
        }
        
    }

</script> -->

<script>
    // 当你希望通过Break来跳出非就近的循环体或者swith语句时，就会用到带标签的break语句。下面是示例代码

    function getData(){
        return  [["0-1","0-2"],["1-1","1-2"],["2-1","2-2"]];
    }
    var matrix = getData();
    console.log(matrix);
    var sum = 0,success = false;
    // 从标签名开始，以便在报错时推出程序
    compute_sum: if(matrix) {
        for (let x = 0; x < matrix.length; x++) {
            var row = matrix[x];
            if(!row) break compute_sum;
            for (let y = 0; y < row.length; y++) {
               var cell = row[y];
                if(isNaN(cell)) break compute_sum;
                sum += cell;
            }
        }
        success = true;
    }
</script>



<head>
    <title>放置文章标题</title>
</head>

<body>
    <!-- <div>
            <h1>Debug Log</h1>
    </div> -->
</body>

</html>